package hn.cch.server.controller;


import hn.cch.common.entity.ExchangeRecord;
import hn.cch.common.exchange.ExchangeInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExchangeController implements ExchangeInterface {

    private static final Logger logger = LoggerFactory.getLogger(ExchangeController.class);

    @Override
    public ExchangeRecord getExchangeRecord(@PathVariable(value = "uuid") String uuid) {
        logger.info("uuid:{}", uuid);
        return new ExchangeRecord(uuid, "name-" + uuid);
    }

    @Override
    public ExchangeRecord setExchangeRecord(@RequestBody ExchangeRecord exchangeRecord) {
        return exchangeRecord;
    }
}
